<template>
  <div>

    <div class="menu-box">
<!--      <div class="title"></div>-->
      <div class="box-2">
        <div class="box-1">
          <el-carousel height="450px">
            <el-carousel-item v-for="item in 2" :key="item">
              <img src="https://static.biaomengwang.com/pcweb/assets/bg_2_left.ab93165a.png" alt="">
            </el-carousel-item>
          </el-carousel>
        </div>
        <div class="right-box-2">
          <div class="item" v-for="(item,index) in list" :key="index">
            <div class="title flex-center-between padding-3">
              <span>{{ item.name }}</span>
              <span>查看更多 <i class="el-icon-s-promotion"></i></span>
            </div>
            <div class="content">
              <a href="javascript:void (0)" v-if="item.categories" v-for="(item1,index1) in item.categories" :key="index1">
                {{item1.categoryName}}
              </a>
            </div>
          </div>
        </div>

      </div>
    </div>

  </div>
</template>

<script>
import {templateTopics} from "@/api/apiFox";

export default {
  data(){
    return{
      list: [],
    }
  },
  methods:{
    getList(){
      templateTopics().then(res=>{
        console.log(res)
        this.list = res
      }).catch(err=>{})
    }
  },
  mounted() {
    this.getList()
  }
}
</script>


<style scoped lang="scss">
.menu-box{
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: url("@/assets/images/bg-index-banner-wave.png") no-repeat;
  background-size:cover ;
  .title{
    width: 1300px;
    height: 100px;
    font-size: 24px;
    padding: 40px 0 0 0;
    box-sizing: border-box;
    .title-top{
      display: flex;
      align-items: center;
      color: #232C3A;
      font-weight: 400;
      font-size: 24px;
      i{
        margin-right: 10px;
        font-size: 28px;
      }
    }
    p{
      width: 100%;
      font-size: 12px;
      margin-top: 5px;
      color: #999;
    }
    .colouredRibbon{
      width: 200px;
      height: 20px;
      background-image: linear-gradient(-225deg, #FFFEFF 0%, #D7FFFE 100%);
    }
  }
  .box-2{
    width: 1300px;
    //margin-top: 30px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    .box-1{
      width: 840px;
      height: 450px;
      img{
        height: 450px;
        object-fit: cover;
        width: 100%;
        border-radius: 10px;
      }
    }
    .right-box-2{
      width: 450px;
      height: 450px;
      overflow-y: scroll;

      .item{
        padding: 5px;
        box-sizing: border-box;
        margin-bottom: 25px;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
        width: 450px;
        background: #fff;
        border-radius: 8px;
        background-image: linear-gradient(180deg,#D6E7FF 0%,#FFFFFF 75%);
        .title{
          width: 100%;
          height: 30px;
          border-top-right-radius: 8px;
          border-top-left-radius: 8px;
          font-size: 14px;
          color:#2155a3;
          span:nth-child(1){
            color:#333;
            font-size: 16px;
            font-weight: 800;
          }
          span:nth-child(2){
            color: #333;
          }
        }
        .content{
          width: 100%;

          padding:15px 10px;
          box-sizing: border-box;
          font-size: 14px;
          display: flex;

          flex-wrap: wrap;
          a{
            margin-left: 10px;
            margin-right: 15px;
            font-size: 14px;
            color: #666;
            margin-top: 10px;
          }
          a:hover{
            color: #F56C6C;
          }
        }
      }
    }

  }
}

</style>